<template>
  <div>{{ a }}</div>
  <test></test>
  <div class="txt">222</div>
  <button @click="changeColor('pink')">改变颜色</button>
</template>

<script setup>
import test from '@/components/test.vue'
import { ref } from 'vue';
const a = 10;
const textColor = ref('red')

const changeColor = (c) => {
  textColor.value = c;
}

</script>

<style scoped lang="scss">
.txt {
  color: v-bind(textColor);
}
</style>
